package designMode.factory.abstractFactory;

import designMode.factory.abstractFactory.impl.ali.AliOrderFactory;
import designMode.factory.abstractFactory.impl.wechat.WechatOrderFactory;

import javax.print.attribute.standard.OrientationRequested;

/**
 * @Author 肖地洋
 * @Date 2022/8/13 11:19
 */
public class AbstractMain {
    public static void main(String[] args) {
        OrderFactory orderFactory  = new AliOrderFactory();
        PayFactory payFactory = orderFactory.creatPayFactory();
        RefundFactory refundFactory = orderFactory.creatRefundFactory();
        payFactory.pay();
        refundFactory.refund();

        OrderFactory orderFactory1  = new WechatOrderFactory();
        PayFactory payFactory1 = orderFactory1.creatPayFactory();
        RefundFactory refundFactory1 = orderFactory1.creatRefundFactory();
        payFactory1.pay();
        refundFactory1.refund();


        OrderFactory orderFactory2  = FactoryProducer.createOrderFactory("WECHAT");
        PayFactory payFactory2 = orderFactory2.creatPayFactory();
        RefundFactory refundFactory2 = orderFactory2.creatRefundFactory();
        payFactory2.pay();
        refundFactory2.refund();


    }
}
